package eu.kuresson.tower.web;

import org.apache.wicket.authroles.authentication.AbstractAuthenticatedWebSession;
import org.apache.wicket.authroles.authentication.AuthenticatedWebApplication;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.spring.injection.annot.SpringComponentInjector;

/**
 * Application object for your web application. If you want to run this application without deploying, run the Start class.
 * 
 * @see eu.kuresson.tower.Start#main(String[])
 */
public class WicketApplication extends AuthenticatedWebApplication {    	
	/**
	 * @see org.apache.wicket.Application#getHomePage()
	 */
	@Override
	public Class<? extends WebPage> getHomePage()
	{
		return DashBoardPage.class;
	}

	/**
	 * @see org.apache.wicket.Application#init()
	 */
	@Override
	public void init()
	{
		super.init();
		//getDebugSettings().setAjaxDebugModeEnabled(false); //Disables wicket ajax debug window in browser
		getComponentInstantiationListeners().add(new SpringComponentInjector(this));
		mountPage("register", RegisterPage.class);
		mountPage("dashBoard", DashBoardPage.class);
		getApplicationSettings().setAccessDeniedPage(DashBoardPage.class); // Insert custom access denied page here
	}

	@Override
	protected Class<? extends WebPage> getSignInPageClass() {
		return DashBoardPage.class;
	}

	@Override
	protected Class<? extends AbstractAuthenticatedWebSession> getWebSessionClass() {
		return SpringWicketWebSession.class;
	}
}
